Component({
  properties: {
    value:{
      type:Number,
      value:0,
      observer(newVal,oldVal,path){
        this.update(this);
      }
    },
    color:{
      type:String,
      value:'#666'
    },
    size:{
      type:Number,
      value:26
    },
    del:null,
    top:{
      type:Number,
      value:0
    },
    right:{
      type:Number,
      value:0
    },
    bottom:{
      type:Number,
      value:0
    },
    left:{
      type:Number,
      value:0
    },
    bold:null,
    showPoint:{
      type:Boolean,
      value:false
    }
  },
  data: {
    valInt:'',
    valDec:'',
    size1:26,
    size2:26,
    size3:26
  },
  lifetimes:{
    attached() {
      //console.log('value:',typeof(this.properties.value));
      this.update(this);
    }
  },
  methods:{
    update(that){
      let arr=that.properties.value.toString().split('.');
      that.setData({valInt: arr[0]});
      if(arr.length==2){
        that.setData({valDec: arr[1].substr(0,2)});
      }else{
        that.setData({valDec: '0'});
      }
      that.setData({size1: parseInt(that.properties.size*0.75)});
      that.setData({size2: parseInt(that.properties.size)});
      that.setData({size3: parseInt(that.properties.size*0.85)});
      //that.setData({size4: parseInt(that.properties.size*0.1)});
    }
  }
})
